<template>
	<div>
		<el-table
			border
			size="mini"
			:data="tableData"
			style="width: 100%"
			:max-height="tableHeight"
			highlight-current-row
			class="small-size-table"
			:header-cell-style="getRowClass"
			show-summary
			:summary-method="(val) => handleRow(val, subSummary)"
		>
			<el-table-column
				prop="eventId"
				align="center"
				min-width="260px"
				:label="$t('funds.order_no')"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<Copy :title="scope.row.eventId" :copy="copy">
						{{ scope.row.eventId }}
					</Copy>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.fund_audit.connect_three_order_no')
					]
				"
				prop="thirdOrderNo"
				align="center"
				min-width="300"
				:label="$t('funds.fund_audit.connect_three_order_no')"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<Copy
						v-if="!!scope.row.thirdOrderNo"
						:title="scope.row.thirdOrderNo"
						:copy="copy"
					>
						{{ scope.row.thirdOrderNo }}
					</Copy>
					<span v-else>-</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.bg_name')]"
				prop="userName"
				align="center"
				:label="$t('funds.bg_name')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<Copy :title="scope.row.userName" :copy="copy">
						{{ scope.row.userName || '-' }}
					</Copy>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('common.number_type')]"
				prop="userName"
				align="center"
				:label="$t('common.number_type')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ (scope.row.userType === 0 ? '会员' : '代理') || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('common.belong_merchant')]"
				prop="merchantName"
				align="center"
				:label="$t('common.belong_merchant')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.merchantName || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.top_proxy_name')
					]
				"
				prop="appTypeStr"
				align="center"
				:label="$t('funds.proxy_member_funds_record.top_proxy_name')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.topProxyUsername || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.parent_proxy_name')
					]
				"
				prop="appTypeStr"
				align="center"
				:label="$t('funds.proxy_member_funds_record.parent_proxy_name')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.parentProxyUsername || '-' }}
				</template>
			</el-table-column>
			<!-- <el-table-column
						prop="vipLevel"
						align="center"
						:label="$t('funds.vip_level')"
						min-width="150"
					>
						<template slot-scope="scope">
							VIP{{ scope.row.vipLevel }}
						</template>
					</el-table-column> -->
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.app_type')
					]
				"
				prop="appTypeStr"
				align="center"
				:label="$t('funds.proxy_member_funds_record.app_type')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ typeFilter(scope.row.appType, 'loginDeviceType') }}
				</template>
			</el-table-column>

			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.order_status')
					]
				"
				prop="orderStatusStr"
				align="center"
				:label="$t('funds.proxy_member_funds_record.order_status')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{
						typeFilter(scope.row.orderStatus, 'withdrawOrderStatus')
					}}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.client_state')
					]
				"
				prop="clientStatusStr"
				align="center"
				:label="$t('funds.proxy_member_funds_record.client_state')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{
						typeFilter(
							scope.row.clientStatus,
							'withdrawClientStatus'
						)
					}}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.withdrawal_ip')
					]
				"
				prop="ip"
				align="center"
				min-width="150px"
				show-overflow-tooltip
			>
				<template slot="header">
					{{ $t('funds.proxy_member_funds_record.withdrawal_ip') }}
					<br />
					{{ $t('funds.wind_control_level') }}
				</template>
				<template slot-scope="scope">
					<span>{{ scope.row.ip || '-' }}</span>
					<br />
					<span class="redColor">
						{{ $t('funds.wind_control_level') }}：{{
							scope.row.ipWindControl || '-'
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.proxy_member_funds_record.withdrawal_terminal_numbe'
						)
					]
				"
				prop="deviceNo"
				align="center"
				min-width="150px"
				show-overflow-tooltip
			>
				<template slot="header">
					{{
						$t(
							'funds.proxy_member_funds_record.withdrawal_terminal_numbe'
						)
					}}
					<br />
					{{ $t('funds.wind_control_level') }}
				</template>
				<template slot-scope="scope">
					<span>{{ scope.row.deviceNo || '-' }}</span>
					<br />
					<span class="redColor">
						{{ $t('funds.wind_control_level') }}：{{
							scope.row.deviceNoWindControl || '-'
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.thirdPeymentChannelConfig.payment_merchant_name'
						)
					]
				"
				prop="paymentMerchantName"
				align="center"
				:label="
					$t('funds.thirdPeymentChannelConfig.payment_merchant_name')
				"
				min-width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.payMerchantName || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.pay_type')]"
				prop="withdrawTypeStr"
				align="center"
				:label="$t('funds.pay_type')"
				min-width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ typeFilter(scope.row.withdrawType, 'withdrawTypeStr') }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.fund_audit.pay_currency')]"
				prop="currency"
				align="center"
				:label="$t('funds.fund_audit.pay_currency')"
				min-width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.currency || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.channel_name')]"
				prop="channelName"
				align="center"
				:label="$t('funds.channel_name')"
				min-width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.channelName || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.withdraw_account')
					]
				"
				prop="bankcardNo"
				align="center"
				:label="$t('funds.proxy_member_funds_record.withdraw_account')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.withdrawType === 1">
						{{ scope.row.bankcardNo || '-' }}
					</span>
					<span
						v-else-if="
							scope.row.withdrawType === 2 ||
								scope.row.withdrawType === 8 ||
								scope.row.withdrawType === 9
						"
					>
						{{ scope.row.usdtAddress || '-' }}
					</span>
					<span v-else>
						-
					</span>
				</template>
			</el-table-column>
			<!-- <el-table-column
						prop="withdrawTypeStr"
						align="center"
						:label="$t('funds.proxy_member_funds_record.withdrawal_type')"
						min-width="150"
					></el-table-column> -->
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.withdraw_info')
					]
				"
				prop="bankName"
				align="center"
				:label="$t('funds.proxy_member_funds_record.withdraw_info')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.withdrawType === 1">
						{{ scope.row.bankName || '-' }}
					</span>
					<span v-else-if="scope.row.withdrawType === 2">
						{{ scope.row.currency || '-' }}
						<br />
						{{
							scope.row.usdtType === 3
								? 'TRC20'
								: scope.row.usdtType === 2
								? 'ERC20'
								: '-'
						}}
					</span>
					<span v-else-if="scope.row.withdrawType === 8 || scope.row.withdrawType === 9">
						{{ scope.row.currency || '-' }}
						{{ scope.row.usdtAddress || '-' }}
					</span>
					<span v-else>
						-
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('common.withdraw_money_wallet')]"
				prop="walletType"
				align="center"
				:label="$t('common.withdraw_money_wallet')"
				min-width="90"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.walletType === 1">
						{{ $t('common.cash_wallet') }}
					</span>
					<span v-else-if="scope.row.walletType === 17">
						{{ $t('common.cash_wallet') }}
					</span>
					<span v-else-if="scope.row.walletType === 21">
						{{ $t('common.earnings_wallet') }}
					</span>
					<span v-else>
						-
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.proxy_member_funds_record.withdraw_order_amount_usdt'
						)
					]
				"
				prop="orderAmountUsdt"
				align="center"
				min-width="200"
				:label="
					$t(
						'funds.proxy_member_funds_record.withdraw_order_amount_usdt'
					)
				"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span>
						{{
							handleNumber(
								scope.row.symbolUsdt,
								scope.row.orderAmountUsdt
							)
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.proxy_member_funds_record.withdraw_order_amount_cny'
						)
					]
				"
				prop="orderAmountCny"
				align="center"
				min-width="200"
				:label="
					$t(
						'funds.proxy_member_funds_record.withdraw_order_amount_cny'
					)
				"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span>
						{{
							handleNumber(
								scope.row.symbolCny,
								scope.row.orderAmountCny
							)
						}}
					</span>
				</template>
			</el-table-column>
			<!-- <el-table-column
						prop="creditLevel"
						align="center"
						min-width="150"
						:label="$t('funds.credit_level')"
					>
						<template slot-scope="scope">
							{{
								scope.row.creditLevel === null
									? '-'
									: scope.row.creditLevel
							}}
						</template>
					</el-table-column> -->
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.proxy_member_funds_record.first_withdraw_status'
						)
					]
				"
				prop="firstWithdrawStatus"
				align="center"
				:label="
					$t('funds.proxy_member_funds_record.first_withdraw_status')
				"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.firstWithdrawStatus === 0">
						{{ $t('common.no') }}
					</span>
					<span v-else-if="scope.row.firstWithdrawStatus === 1">
						{{ $t('common.yes') }}
					</span>
					<span v-else>-</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t(
							'funds.proxy_member_funds_record.is_big_withdraw_amount'
						)
					]
				"
				prop="bigWithdraw"
				align="center"
				:label="
					$t('funds.proxy_member_funds_record.is_big_withdraw_amount')
				"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.bigWithdraw === 0">
						{{ $t('common.no') }}
					</span>
					<span v-else-if="scope.row.bigWithdraw === 1">
						{{ $t('common.yes') }}
					</span>
					<span v-else>-</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.apply_time')]"
				prop="eventTime"
				align="center"
				:label="$t('funds.apply_time')"
				min-width="160"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.eventTime || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.paragraph_time')
					]
				"
				prop="payTime"
				align="center"
				:label="$t('funds.proxy_member_funds_record.paragraph_time')"
				min-width="160"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.payTime || '-' }}
				</template>
			</el-table-column>
			<!-- <el-table-column
						prop="pictureUrl"
						align="center"
						:label="
							$t(
								'funds.proxy_member_funds_record.preview_picture'
							)
						"
						min-width="150"
					>
						<template slot-scope="scope">
							<el-link
								v-if="scope.row.pictureUrl"
								type="primary"
								@click="lookImg(scope.row.pictureUrl)"
							>
								{{
									$t('funds.proxy_member_funds_record.checks')
								}}
							</el-link>
							<span v-else>-</span>
						</template>
					</el-table-column> -->
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.audit_desc')
					]
				"
				prop="remark"
				align="center"
				:label="$t('funds.proxy_member_funds_record.audit_desc')"
				min-width="200"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.remark || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.audit_client_desc')
					]
				"
				prop="confirmClientDesc"
				align="center"
				:label="$t('funds.proxy_member_funds_record.audit_client_desc')"
				min-width="200"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.confirmClientDesc || '-' }}
				</template>
			</el-table-column>
		</el-table>
		<!-- 分页 -->
		<el-pagination
			v-show="!!total"
			:current-page.sync="pageNum"
			class="pageValue"
			background
			layout="total, sizes,prev, pager, next, jumper"
			:page-size="pageSize"
			:page-sizes="pageSizes"
			:total="total"
			:pager-count="9"
			@current-change="handleCurrentChange"
			@size-change="handleSizeChange"
		></el-pagination>
	</div>
</template>

<script>
import list from '@/mixins/list'
import summaryList from './summaryList2'
export default {
	mixins: [list, summaryList],
	props: {
		tableHeight: {
			type: Number,
			default: 480
		},
		searchLoading: {
			type: Boolean,
			default: false
		},
		tableData: {
			type: Array,
			default: () => {}
		},
		subSummary: {
			type: Object,
			default: () => {}
		},
		totalSummary: {
			type: Object,
			default: () => {}
		},
		allPayoutStatus: {
			type: Array,
			default: () => {}
		},
		activityList: {
			type: Object,
			default: () => {}
		}
	},
	data() {
		return {}
	},
	created() {
		this.initIndexDB('platformWithdrawalRecords', this.activityList)
	}
}
</script>
